package com.tsd.core.openweixin.model;

import java.util.Objects;

/**
 * @author eric
 */
public class AccessTokenOauth2 {

    private final String token;
    private final String refreshToken;
    private final String openId;
    private final String scope;
    private final Long expiresTimestemp;

    public AccessTokenOauth2(String token, Long expiresTimestemp, String openId, String refreshToken, String scope) {
        this.token = token;
        this.expiresTimestemp = expiresTimestemp;
        this.openId = openId;
        this.scope = scope;
        this.refreshToken = refreshToken;
    }

    public String getToken() {
        return token;
    }

    public Long getExpiresTimestemp() {
        return expiresTimestemp;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AccessTokenOauth2 other = (AccessTokenOauth2) obj;
        return Objects.equals(this.token, other.token);
    }

    @Override
    public String toString() {
        return "AccessToken{" + "token=" + token + ", expiresTimestemp=" + expiresTimestemp +
                ",openId=" + openId + ",refreshToken=" + refreshToken + ",scope=" + scope + '}';
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public String getOpenId() {
        return openId;
    }

    public String getScope() {
        return scope;
    }

}
